package main

import (
	"errors"
	"fmt"
	"log"

	"github.com/globalsign/mgo"
)

func main() {
	err := fmt.Errorf("%s:%w", "test", mgo.ErrNotFound)
	if errors.Is(err, mgo.ErrNotFound) {
		log.Print("err is mgo.ErrNotFound")
	} else {
		log.Print("err is not mgo.ErrNotFound")
	}

	if e := errors.Unwrap(err); errors.Is(e, mgo.ErrNotFound) {
		log.Print("e is mgo.ErrNotFound")
	} else {
		log.Print("e is not mgo.ErrNotFound")
	}
}
